﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;

using Vroom.Services.Net;


namespace Vroom.Services.Net.WindowsService
{
	public partial class VroomNetWindowsService : ServiceBase
	{
		internal static ServiceHost VroomServiceHost = null; 

		public VroomNetWindowsService()
		{
			InitializeComponent();
		}

		protected override void OnStart(string[] args)
		{
			if (VroomServiceHost != null)
			{
				VroomServiceHost.Close();
			}
			VroomServiceHost = new ServiceHost(typeof(VroomNetWindowsService));
			VroomServiceHost.Open();
		}

		protected override void OnStop()
		{
			if (VroomServiceHost != null)
			{
				VroomServiceHost.Close();
				VroomServiceHost = null;
			}
		}
	}
}
